import React, { Suspense, lazy } from 'react'
import { Switch, Route, Redirect } from 'react-router-dom';
import List from "./List";
import Activity from './Activity';
import News from './News'

function Default(props) {
  const baseUrl = props.match.path;
  return (
    <div>
      <Switch>
        {/* <Suspense fallback={<h1>Loading....</h1>}> */}
          <Route path={baseUrl + "/list"} component={List} />
          <Route path={baseUrl + "/activity"} component={Activity} />
          <Route path={baseUrl + "/news"} component={News} />
          <Redirect from={baseUrl} to={baseUrl + '/list'} />
        {/* </Suspense> */}
      </Switch>
    </div>
  )
}

export default Default;